// 提供全局的getters
const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token, //  将token挂载到全局的getters中
  name: state => state.user.userInfo.username, //  将用户名挂载到全局的getters中
  staffPhoto: state => state.user.userInfo.staffPhoto, //  将用户头像挂载到全局的getters中
  routes: state => state.permission.routes,
  roles: state => state.user.userInfo.roles.points,
  userInfo: state => state.user.userInfo
  // staffPhoto: 'http://www.baidu.com/xxx---s_%%#aaa.jpg' //  如果使用的是线上接口,图片没有加载失败,模拟失败
}
export default getters
